package com.example.service.drug;

import com.example.entity.drugDTO.DrugMatchingRequest;
import com.example.service.utils.PythonExecuteUtil;
import org.springframework.stereotype.Service;

/**
 * 药品推荐服务
 */
@Service
public class DrugMatchingService {

    /**
     * 推荐药品
     * @param request 药品推荐请求
     * @return 推荐的药品名称
     */
    public String recommendMedicine(DrugMatchingRequest request) {
        try {
            // 调用Python脚本获取推荐结果
            return PythonExecuteUtil.executeDrugMatching(request);
        } catch (Exception e) {
            throw new RuntimeException("药品推荐服务异常: " + e.getMessage(), e);
        }
    }



}
